<!--
 * @Author: ke.xue
 * @Date: 2023-11-14 10:07:22
 * @LastEditors: ke.xue
 * @LastEditTime: 2023-11-20 15:21:18
 * @FilePath: \html\maskButton.html
 * @Description: 文件描述
-->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>图片样式</title>
  <style>
    .imgBox {
      width: 300px;
      height: 200px;
      overflow: hidden;
      text-align: center;
      border: 1px solid #999;
      background: #00f;
      position: relative;
    }
    .imgBox img {
      max-width: 100%;
      height: 100%;
    }
    .buttonBox {
      position: absolute;
      width: 100%;
      height: 100%;
      top: 0;
      left: 0;
      display: none;
      align-items: center;
      background: rgba(0, 0, 0, .4);
    }
    .buttonBox span {
      display: block;
      flex: 1;
      font-size: 16px;
      line-height: 32px;
      text-align: center;
    }
    .imgBox:hover .buttonBox {
      display: flex;
    }
  </style>
</head>
<body>
  <div>
    <h1>图片样式</h1>
    <div class="imgBox">
      <img src="./img/fang.png" alt="">
      <div class="buttonBox">
        <span>预览</span>
        <span>删除</span>
      </div>
    </div>
    <div class="imgBox">
      <img src="./img/lang.png" alt="">
      <div class="buttonBox">
        <span>预览</span>
        <span>删除</span>
      </div>
    </div>
    <div class="imgBox">
      <img src="./img/height.png" alt="">
      <div class="buttonBox">
        <span>预览</span>
        <span>删除</span>
      </div>
    </div>
  </div>
</body>
</html>